package com.cn.sl.server.api.system.user.repository

import com.cn.sl.server.api.system.user.model.entity.AdminUserEntity
import com.cn.sl.server.common.repository.BaseRepository
import org.springframework.stereotype.Repository

@Repository
interface AdminUserRepository : BaseRepository<AdminUserEntity> {
    fun findAllByUsernameAndDel(username: String, del: Boolean = false): List<AdminUserEntity>

    fun findFirstByUsernameAndDel(username: String, del: Boolean = false): AdminUserEntity?

    fun findFirstByUsernameAndIdNotAndDel(username: String, id: Long, del: Boolean = false): AdminUserEntity?

    fun findByDepartmentIdAndDel(departmentId: Long, del: Boolean = false): List<AdminUserEntity>

    fun findFirstByPhoneAndDel(phone: String, del: Boolean = false): AdminUserEntity?

    fun findAllByDepartmentIdInAndDel(departmentIds: List<Long>, del: Boolean = false): List<AdminUserEntity>
}